<?php
$appid = "wx82535378dd69c23b";
$appsecret = "7d79171cc31d19f20d73af1b6d3c961d";
define("APPID",$appid);
define("APPSECRET",$appsecret);
$token_access_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . APPID . "&secret=" . APPSECRET;
$res = file_get_contents($token_access_url);
//获取文件内容或获取网络请求的内容
echo $res;
$result = json_decode($res, true);
//接受一个 JSON 格式的字符串并且把它转换为 PHP 变量
$access_token = $result['access_token'];
echo $access_token;
// echo '<br>';// print_r($result);